<!--{eval $_TPL['titles'] = array('猜猜你下辈子会变成啥？');}-->
<!--{template app/app_header_tpl}-->
    <div class="left">
		<div class="title"><a href="<!--{eval echo base_url();}-->" onClick="_gaq.push(['_trackEvent', 'sinapp1', 'click', 'top1', 1]);" target="_blank">第6街区</a></div>
		<div class="gamebg">
				<form action="<!--{eval echo base_url();}-->sina_app/guesswillbecomewhat/index" method="post" accept-charset="utf-8" id="gameform" onsubmit="return toKnow(1);">
				<div class="game_title">猜猜你下辈子会变成啥？</div>

				<div class="shar">
					<p>
						<!--{if isset($user)}-->
							Hi {$user[name]}
						<!--{else}-->
							快来试试吧
						<!--{/if}-->
					</p>
					<p>	<input id="testName" name="testname" class="testName" onfocus="if(this.value=='请输入你的名字'){this.value='';} this.style.color='#FF0000'" value="{$username}" onblur="if(this.value==''){ this.style.color='#FF0000';this.value='请输入你的名字'}" type="text">
						<!--{if isset($user)}-->
							<input type="submit"  value= "我也来试试"  onClick="_gaq.push(['_trackEvent', 'sinapp1', 'click', 'play', 1]);"/>
						<!--{else}-->
								<input type="button" onclick="_gaq.push(['_trackEvent', 'sinapp1', 'click', 'towblogintry', 1]);window.location.href='<!--{eval echo base_url();}-->app/sina/{$appid}/{$username}';" value="我也来试试"/>
						<!--{/if}-->
					</p>
			
					<p>
				  		<!--{if $gamepic}-->
							<img src="{$gamepic}" id="gamepic"/>
						<!--{else}-->
							<img src="<!--{eval echo base_url();}-->resources/images/app/gwbcw/bg.png" id="gamepic"/>
						<!--{/if}-->
					</p>
				</div>
				<div class="shar">
					<!--{if isset($user)}-->
					<a href="<!--{eval echo base_url();}-->sina_app/guesswillbecomewhat/towb/{$username}" onclick="_gaq.push(['_trackEvent', 'sinapp1', 'click', 'towb', 1]);"><img src="<!--{eval echo base_url();}-->resources/images/app/gwbcw/sina.png" width="174" height="32" border='0'/></a>
					<!--{else}-->
					<a href="<!--{eval echo base_url();}-->app/sina/{$appid}/{$username}" onclick="_gaq.push(['_trackEvent', 'sinapp1', 'click', 'towblogin', 1]);"/>
							<img src="<!--{eval echo base_url();}-->resources/images/app/gwbcw/sina.png" width="174" height="32" border='0'/>
					</a>
					<!--{/if}-->	
					<a onclick="CopyImage(document.getElementById('gamepic'));_gaq.push(['_trackEvent', 'sinapp1', 'click', 'copyqq', 1]);" title="复制到QQ" href="#" >
					<img src="<!--{eval echo base_url();}-->resources/images/app/gwbcw/toQQ.gif" border='0'>
					</a>
				</div>
			</form>
		</div>
		<div class="text"><a href="<!--{eval echo base_url();}-->" onClick="_gaq.push(['_trackEvent', 'sinapp1', 'click', 'bottom1', 1]);" target="_blank">第6街区 国内最大品牌折扣资讯站！ZARA，Dior 限时3折抢购！</a></div>
    </div>

    <div class="right">
		<!--{template app/app_right_tpl}-->
    </div>
</div>

<script type="text/javascript">
function CopyImage(img){
	if (img.tagName != 'IMG'){return false;}
	if (typeof img.contentEditable == 'undefined' || !document.body.createControlRange){
		alert("抱歉您的浏览器不支持直接复制，请在图片上右击复制图片");
	}else{
	var ctrl = document.body.createControlRange();
	img.contentEditable = true;
	ctrl.addElement(img);
	ctrl.execCommand('Copy');
	img.contentEditable = false;
		alert("图片复制成功，直接在QQ聊天窗口粘贴（Ctrl+V）即可");
	}
}
function toKnow(M){
	var nameValue = document.getElementById('testName').value;
	nameValue = nameValue.replace(/(^\s*)|(\s*$)/g,"");
	//alert(nameValue);
	if(nameValue.length==0||nameValue=='请输入你的名字'||nameValue.replace(/[ ]/g,"")==''){
		alert("请输入你要测试名字");
		return false;
	}else{
		var reg1 =/^[\u4e00-\u9fa5]+$/;
		if(reg1.test(nameValue)){
			if(nameValue.length>6){
				alert("输入的名字大于6个汉字喽");
				return false;
				}
		}	
		var reg2 =/^[a-zA-Z]+$/;
		if(reg2.test(nameValue)){
			if(nameValue.length>10){
				alert("输入的字母大于10个喽");
				return false;
				}
		}	
		if(nameValue.search("&")>=0){
			alert("名字有特殊字符&");
			return false;
		}
		function leng(s){
		var l = 0;
		var a = s.split("");
		for(var i=0;i<a.length;i++){
				l+=3;
		}
		return l;
		}
		var lengs = leng(nameValue);
		if(lengs>24){
			if(!reg2.test(nameValue)){
			alert("测试的名字太长了");
			return false;
			}
		}
	}
	
}
</script>
<!--{template app/app_footer_tpl}-->